package com.beiming.moudle.auth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.beiming.moudle.auth.dao.OrderDao;
import com.beiming.moudle.auth.entity.BussEntity;
import com.beiming.moudle.auth.entity.OrderEntity;
import com.beiming.moudle.auth.entity.utillClass.OrderPage;
import com.beiming.moudle.auth.service.OrderService;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderDao, OrderEntity> implements OrderService {

    @Autowired
    private OrderDao orderDao;
    @Override
    public IPage<OrderEntity> getMsgPage(OrderPage orderPage) {
        LambdaQueryWrapper<OrderEntity> lqw = new LambdaQueryWrapper<>();
        lqw.like(null!=(orderPage.getOrderSn()),OrderEntity::getOrderSn,orderPage.getOrderSn());
        IPage pag = new Page(orderPage.getCurrentPage(),orderPage.getPageSize());
        orderDao.selectPage(pag,lqw);
        return pag;
    }
}
